<template>
  <div style="text-align: left">
    <el-dialog
      title="编辑信息"
      :visible.sync="dialogFormVisible"
      @close="clearData"
      width="30%"
      center>
      <el-form :model="confirmForm" :rules="rules" class="confirm-container" label-position="left"
               label-width="80px">
        <el-form-item prop="enabled" label="是否启用">
          <el-select v-model="confirmForm.enabled" placeholder="请选择" clearable>
            <el-option
              v-for="item in options1"
              :key="item.value"
              :label="item.label"
              :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button style="" @click="confirm">提交
        </el-button>
        <el-button @click="dialogFormVisible = false" style="">取 消
        </el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: 'UserEdit',
  data () {
    return {
      options1: [{
        value: 1,
        label: '启用'
      }, {
        value: 0,
        label: '禁用'
      }],
      dialogFormVisible: false,
      confirmForm: {
        acc: '',
        sfid: '',
        enabled: ''
      },
      rules: {}
    }
  },
  methods: {
    confirm () {
      this.$axios.post('/admin/blacklist_manager/editInfo', {
        acc: '',
        name: '',
        sfid: '',
        enabled: ''
      }).then(resp => {
        this.dialogFormVisible = false
      }).catch(failResponse => {
        alert('服务器响应请求失败！')
      })
    },
    clearData () {
      Object.assign(this.$data, this.$options.data.call(this))
    }
  }
}
</script>

<style scoped>
.confirm-container {
  background-clip: padding-box;
  margin: 5px 5px;
  width: 350px;
  padding: 15px 15px 15px 15px;
  background: #fff;
}
</style>
